package com.take.state;

import com.take.common.CustomException;

/**
 * 待发货状态：有发货事件、取消（没发货就能取消）
 */
public class WaitDeliverState implements OrderState {

    @Override
    public OrderStateEnum orderStateType() {
        return OrderStateEnum.WAIT_DELIVER;
    }

    @Override
    public void deliver(OrderStateMachine stateMachine) {
        stateMachine.setCurrentState(new WaitReceiveState());
    }

    @Override
    public void cancel(OrderStateMachine stateMachine) throws CustomException {
        stateMachine.setCurrentState(new CancelState());
    }
}
